<!DOCTYPE html>
<html lang="zh-CN">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <script>
        // 1.localStorage.setItem('键'，'值')
        localStorage.setItem('uname', 'pink老师')
        // 2.获取方式
        localStorage.getItem('uname')
        console.log(localStorage.getItem('uname'));
        // 3.改
        localStorage.setItem('uname', 'red')


        // 注意 本地储存只能存储字符串类型
        localStorage.setItem('age', 18)
        console.log(localStorage.getItem('age', 18));
    </script>
</body>

</html>